;;(function ($) {
    var heightArr = [];
    $.fn.waterFall = function (options) {
        options = $.extend({col: 3}, options);
        for (let i = 0; i < this.length; i++) {
            console.log(1)
            if (i < options.col) {
                heightArr.push(this.eq(i).height());
            }else{
                
                var heightMin = Math.min.apply(false, heightArr);
                var minIndex = heightArr.indexOf(heightMin);
                this.eq(i).offset({
                    left: this.eq(minIndex).offset().left,
                    top: heightMin + 20
                })
                heightArr[minIndex] += this.eq(i).height() + 20;
            }

        }
    }
})(jQuery);